<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.Collection"%>
<%@ page import="icst.cyber.hrm.bo.JobBO"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>

<%
JobBO jobBO = new JobBO();
Collection jobs = jobBO.getAllJob();
request.setAttribute("jobs", jobs);
%>

<div class="section table_section">
    <!--[if !IE]>start title wrapper<![endif]-->
    <div class="title_wrapper">
        <h2>Management Job</h2>
        <span class="title_wrapper_left"></span>
        <span class="title_wrapper_right"></span>
    </div>
    <!--[if !IE]>end title wrapper<![endif]-->
    <!--[if !IE]>start section content<![endif]-->
    <div class="section_content">
        <!--[if !IE]>start section content top<![endif]-->
        <div class="sct">
            <div class="sct_left">
                <div class="sct_right">
                    <div class="sct_left">
                        <div class="sct_right">
                            <form name="frmJob" action="#">
                                <fieldset>
                                    <div class="table_wrapper">
                                        <div class="table_wrapper_inner">
                                            <div id="container">
                                                <table id="tblJob" cellpadding="0" cellspacing="0" border="0" class="display">
                                                    <thead>
                                                        <tr>
                                                            <th width="15%">No.</th>
                                                            <th width="70%">Name</th>
                                                            <th>Action</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                    	<bean:define id="no" value="1" type="java.lang.String" toScope="page"/>
                                                    	<logic:iterate id="one" name="jobs">                                                    		
	                                                        <tr class="gradeA">
	                                                            <td><%= no %></td>
	                                                            <td><bean:write name="one" property="name"/></td>
		                                                        <td>
		                                                            <div class="actions_menu">
		                                                                <ul>
		                                                                    <li><a class="edit" href="Manager.do?opt=config&task=job&act=edit&id=<bean:write name="one" property="id"/>">Edit</a></li>
		                                                                    <li><a class="delete" href="Manager.do?opt=config&task=job&act=delete&id=<bean:write name="one" property="id"/>">Delete</a></li>
		                                                                </ul>
		                                                            </div>
		                                                        </td>
	                                                       	</tr>
	                                                       	<% Integer no1 = Integer.parseInt(no) + 1; no = no1.toString(); %>
	                                                       	<bean:define id="no" value="<%= no %>" type="java.lang.String" toScope="page"/>
                                                       	</logic:iterate>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="table_menu">
                                        <ul class="right">
                                            <li><a href="Manager.do?opt=config&task=job&act=new" class="button add_new"><span><span>ADD NEW</span></span></a></li>
                                        </ul>
                                    </div>
                                </fieldset>
                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>

        <span class="scb">
            <span class="scb_left"></span>
            <span class="scb_right"></span>
        </span>

    </div>
</div>

<script language="javascript" type="text/javascript">
    var tblJob_Props =
        {
        paging: true,
        paging_length: 5,
        rows_counter: true,
        rows_counter_text: "Total rows: ",
        btn_reset: true,
        col_0:"none",
        col_2:"none",
        btn: true,
        btn_text: " Go ",
        loader: true,
        display_all_text: " [ Show all ] ",
        loader_text: "Filtering data..."
    };
    setFilterGrid("tblJob", tblJob_Props );
</script>